package com;

import java.nio.charset.StandardCharsets;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

public class St {
	public static void main(String[] args) {

		byte[] req = "QUERY TIME ORDER".getBytes(StandardCharsets.UTF_8);
		System.out.println(req.length);
		ByteBuf firstMessage = Unpooled.buffer(req.length);
		System.out.println(firstMessage.readableBytes());
		firstMessage.writeBytes(req);
		System.out.println(firstMessage.readableBytes());
		{
			byte[] rr = new byte[firstMessage.readableBytes()];
			firstMessage.readBytes(rr);
			String body = new String(rr, StandardCharsets.UTF_8);
			System.out.println("req is : " + body);
		}

	}
}
